package com.jiutong.meipengdai.http.model.requests;

import com.jiutong.meipengdai.http.RetrofitHandle;
import com.jiutong.meipengdai.http.SubscribeHandler;
import com.jiutong.meipengdai.http.model.services.LoanRelaService;

import java.util.Map;

import rx.Observable;
import rx.Subscriber;

/**
 * Created by suxi on 2017/6/5.
 */

public class LoanApplyRequest extends SubscribeHandler{
    /**
     * 贷款申请
     * @param subscriber
     * @param fields
     */
    public void loanApply(Subscriber subscriber, Map<String, Object> fields) {

        fields.put("method", "evalue.doLoanApply");
        fields.put("v", "2.0");
        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(LoanRelaService.class)
                .loanApply(fields);
        toSubscribe(observable, subscriber);
    }

    /**
     * 我要贷款
     * @param subscriber
     * @param fields
     */
    public void toLoanApply(Subscriber subscriber, Map<String, Object> fields) {

        fields.put("method", "evalue.toLoanApply");
        fields.put("v", "2.0");
        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(LoanRelaService.class)
                .toLoanApply(fields);
        toSubscribe(observable, subscriber);
    }

}
